Class: GOBL::Bill::Order

Inherits:
Object show all
Defined in:
lib/generated/gobl/bill/order.rb

Overview

Order documents are used for the initial part of a order-to-invoice process where the buyer requests goods or services from the seller.

Constant Summary collapse

SCHEMA_ID =

The Schema ID of the GOBL Order structure

'https://gobl.org/draft-0/bill/order'
TYPE_ENUM =

Enumeration of possible values for #type with their corresponding descriptions

{
  'purchase' => 'A purchase order is a document that a buyer sends to a seller to request goods or services.',
  'sale' => 'A sales order is a document that a seller sends to a buyer to confirm the sale of goods or services.',
  'quote' => 'A quote is a document that a seller sends to a buyer to provide a price for goods or services.'
}.freeze

Instance Attribute Summary collapse

Method Summary

Methods inherited from Object

new

Methods inherited from Struct

#as_json, from_data, from_json!, #to_json

Instance Attribute Details

#$addons($addons) ⇒ Array<GOBL::CBC::Key> (readonly)

Addons defines a list of keys used to identify tax addons that apply special normalization, scenarios, and validation rules to a document.

Returns:



46
# File 'lib/generated/gobl/bill/order.rb', line 46

property :$addons, [GOBL::CBC::Key]

#$regime($regime) ⇒ GOBL::L10n::TaxCountryCode (readonly)



40
# File 'lib/generated/gobl/bill/order.rb', line 40

property :$regime, GOBL::L10n::TaxCountryCode

#$tags($tags) ⇒ Array<GOBL::CBC::Key> (readonly)

Tags are used to help identify specific tax scenarios or requirements that will apply changes to the contents of the invoice. Tags by design should always be optional, it should always be possible to build a valid invoice without any tags.

Returns:



51
# File 'lib/generated/gobl/bill/order.rb', line 51

property :$tags, [GOBL::CBC::Key]

#attachmentsArray<GOBL::Org::Attachment> (readonly)

Attachments provide additional information or supporting documents that are not included in the main document. It is important that attachments are not used for alternative versions of the PDF, for that, see “links” inside the envelope headers.

Returns:



205
# File 'lib/generated/gobl/bill/order.rb', line 205

property :attachments, [GOBL::Org::Attachment]

#buyerGOBL::Org::Party (readonly)

Party who is responsible for issuing payment, if not the same as the customer.

Returns:



150
# File 'lib/generated/gobl/bill/order.rb', line 150

property :buyer, GOBL::Org::Party

#chargesArray<GOBL::Bill::Charge> (readonly)

Charges or surcharges applied to order totals

Returns:



170
# File 'lib/generated/gobl/bill/order.rb', line 170

property :charges, [GOBL::Bill::Charge]

#codeGOBL::CBC::Code (readonly)

Code is a sequential identifier that uniquely identifies the order. The code can be left empty initially, but is required to sign the document.

Returns:



79
# File 'lib/generated/gobl/bill/order.rb', line 79

property :code, GOBL::CBC::Code

#complementsArray<GOBL::Schema::Object> (readonly)

Additional complementary objects that add relevant information to the order.

Returns:



195
# File 'lib/generated/gobl/bill/order.rb', line 195

property :complements, [GOBL::Schema::Object]

#contractsArray<GOBL::Org::DocumentRef> (readonly)

The identification of contracts.

Returns:



114
# File 'lib/generated/gobl/bill/order.rb', line 114

property :contracts, [GOBL::Org::DocumentRef]

#currencyGOBL::Currency::Code (readonly)

Currency for all invoice totals.



104
# File 'lib/generated/gobl/bill/order.rb', line 104

property :currency, GOBL::Currency::Code

#customerGOBL::Org::Party (readonly)

Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices.

Returns:



145
# File 'lib/generated/gobl/bill/order.rb', line 145

property :customer, GOBL::Org::Party

#deliveryGOBL::Bill::DeliveryDetails (readonly)

Specific details on delivery of the goods to copy to the final invoice.



180
# File 'lib/generated/gobl/bill/order.rb', line 180

property :delivery, GOBL::Bill::DeliveryDetails

#discountsArray<GOBL::Bill::Discount> (readonly)

Discounts or allowances applied to order totals

Returns:



165
# File 'lib/generated/gobl/bill/order.rb', line 165

property :discounts, [GOBL::Bill::Discount]

#exchange_ratesArray<GOBL::Currency::ExchangeRate> (readonly)

Exchange rates to be used when converting the invoices monetary values into other currencies.

Returns:



109
# File 'lib/generated/gobl/bill/order.rb', line 109

property :exchange_rates, [GOBL::Currency::ExchangeRate]

#identitiesArray<GOBL::Org::Identity> (readonly)

Additional codes, IDs, SKUs, or other regional or custom identifiers that may be used to identify the order.

Returns:



124
# File 'lib/generated/gobl/bill/order.rb', line 124

property :identities, [GOBL::Org::Identity]

#issue_dateGOBL::Cal::Date (readonly)

When the invoice was created.

Returns:



84
# File 'lib/generated/gobl/bill/order.rb', line 84

property :issue_date, GOBL::Cal::Date

#issue_timeGOBL::Cal::Time (readonly)

IssueTime is an optional field that may be useful to indicate the time of day when the order was issued. Some regions and formats may require this field to be set. An empty string will be automatically updated to reflect the current time, otherwise the field can be left with a nil value.

Returns:



89
# File 'lib/generated/gobl/bill/order.rb', line 89

property :issue_time, GOBL::Cal::Time

#linesArray<GOBL::Bill::Line> (readonly)

List of lines representing each of the items to be ordered.

Returns:



160
# File 'lib/generated/gobl/bill/order.rb', line 160

property :lines, [GOBL::Bill::Line]

#metaGOBL::CBC::Meta (readonly)

Additional semi-structured data that doesn’t fit into the body of the order.

Returns:



200
# File 'lib/generated/gobl/bill/order.rb', line 200

property :meta, GOBL::CBC::Meta

#notesArray<GOBL::Org::Note> (readonly)

Unstructured information that is relevant to the order, such as correction or additional legal details.

Returns:



190
# File 'lib/generated/gobl/bill/order.rb', line 190

property :notes, [GOBL::Org::Note]

#op_dateGOBL::Cal::Date (readonly)

Date when the operation defined by the invoice became effective.

Returns:



94
# File 'lib/generated/gobl/bill/order.rb', line 94

property :op_date, GOBL::Cal::Date

#paymentGOBL::Bill::PaymentDetails (readonly)

Information on when, how, and to whom a final invoice would be paid.



175
# File 'lib/generated/gobl/bill/order.rb', line 175

property :payment, GOBL::Bill::PaymentDetails

#periodGOBL::Cal::Period (readonly)

Period of time in which the order is valid.

Returns:



129
# File 'lib/generated/gobl/bill/order.rb', line 129

property :period, GOBL::Cal::Period

#precedingArray<GOBL::Org::DocumentRef> (readonly)

Key information regarding previous order documents.

Returns:



119
# File 'lib/generated/gobl/bill/order.rb', line 119

property :preceding, [GOBL::Org::DocumentRef]

#sellerGOBL::Org::Party (readonly)

Seller is the party liable to pay taxes on the transaction if not the same as the supplier.

Returns:



155
# File 'lib/generated/gobl/bill/order.rb', line 155

property :seller, GOBL::Org::Party

#seriesGOBL::CBC::Code (readonly)

Series is used to identify groups of orders by date, business area, project, type, customer, a combination of any, or other company specific data. If the output format does not support the series as a separate field, it will be prepended to the code for presentation with a dash (‘-`) for separation.

Returns:



74
# File 'lib/generated/gobl/bill/order.rb', line 74

property :series, GOBL::CBC::Code

#supplierGOBL::Org::Party (readonly)

The entity supplying the goods or services and usually responsible for paying taxes.

Returns:



139
# File 'lib/generated/gobl/bill/order.rb', line 139

property :supplier, GOBL::Org::Party

#taxGOBL::Bill::Tax (readonly)

Special tax configuration for billing.

Returns:



134
# File 'lib/generated/gobl/bill/order.rb', line 134

property :tax, GOBL::Bill::Tax

#totalsGOBL::Bill::Totals (readonly)

Summary of all the order totals, including taxes (calculated).

Returns:



185
# File 'lib/generated/gobl/bill/order.rb', line 185

property :totals, GOBL::Bill::Totals

#typeGOBL::CBC::Key (readonly)

Type of the order.

Returns:



68
# File 'lib/generated/gobl/bill/order.rb', line 68

property :type, GOBL::CBC::Key

#uuidString (readonly)

Universally Unique Identifier.

Returns:

  • (String)


56
# File 'lib/generated/gobl/bill/order.rb', line 56

property :uuid, String

#value_dateGOBL::Cal::Date (readonly)

When the taxes of this invoice become accountable, if none set, the issue date is used.

Returns:



99
# File 'lib/generated/gobl/bill/order.rb', line 99

property :value_date, GOBL::Cal::Date